﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls;
using BE_CruzDelSur;
using BR_CruzDelSur;
using BR_CruzDelSur.Interfaces;

namespace WebCruzDelSur
{
    public partial class Main : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            lnkGuiaRemision.Style.Add("visibility", "hidden");
            lnkProgramacionRuta.Style.Add("visibility", "hidden");
            lnkCarga.Style.Add("visibility", "hidden");
            lnkRecojo.Style.Add("visibility", "hidden");
            lnkReporte.Style.Add("visibility", "hidden");

            if (HttpContext.Current.Session["Usuario"] != null)
            {
                BE_Usuario entUsuario = ((BE_Usuario)HttpContext.Current.Session["EntUsuario"]);

                if (entUsuario.Rol == "CLIENTE")
                {
                    lnkReporte.Style.Add("visibility", "visible");
                }
                else
                {
                    lnkGuiaRemision.Style.Add("visibility", "visible");
                    lnkProgramacionRuta.Style.Add("visibility", "visible");
                    lnkCarga.Style.Add("visibility", "visible");
                    lnkRecojo.Style.Add("visibility", "visible");
                }                
            }
        }
    }
}